using System;

namespace CinemaDirector
{
	[Serializable]
	public class GGVariableTypeCurrent<T> : GGVariableType<T> where T : new()
	{
		public ValueType valueType;

		[NonSerialized]
		public T current;

		public bool isCurrent
		{
			get
			{
				GGVariableTypeCurrent<T> gGVariableTypeCurrent = this;
				if (localStore != null)
				{
					gGVariableTypeCurrent = GetVariable<GGVariableTypeCurrent<T>>(localStore);
				}
				return gGVariableTypeCurrent.valueType == ValueType.Current;
			}
		}

		public override T value
		{
			get
			{
				GGVariableTypeCurrent<T> gGVariableTypeCurrent = this;
				if (localStore != null)
				{
					gGVariableTypeCurrent = GetVariable<GGVariableTypeCurrent<T>>(localStore);
				}
				if (gGVariableTypeCurrent.valueType == ValueType.Current)
				{
					return gGVariableTypeCurrent.current;
				}
				return gGVariableTypeCurrent.storedValue;
			}
			set
			{
				storedValue = value;
			}
		}

		public void SetCurrent(T current)
		{
			this.current = current;
		}
	}
}
